package com.totem.base.enums;

import lombok.Getter;

@Getter
public enum JournalStateEnum {
    PENDING("PENDING"),
    PROCESSING("PROCESSING"),
    CANCEL("CANCEL"),
    FINISHED("FINISHED");

    private final String code;

    JournalStateEnum(String code){
        this.code = code;
    }

    public static JournalStateEnum byCode(String code) {
        for (JournalStateEnum e: JournalStateEnum.values()) {
            if (e.code.equalsIgnoreCase(code)) {
                return e;
            }
        }
        return null;
    }
}
